﻿Imports System.Net.Mail
Imports System.IO
Imports System
Imports Microsoft.VisualBasic

Public Class MetodosComuns
    Public Shared Function ConverteTextoParaDecimal(ByVal strTexto As String) As Decimal
        Dim decimalTeste As String = "10,000"
        Dim dec As Decimal = 0
        'Testa para ver se a formatacao de numeros eh ingles ou portugues
        If Convert.ToDecimal(decimalTeste) = 10000 Then
            ' eh ingles
            dec = Convert.ToDecimal(strTexto)
        ElseIf Convert.ToDecimal(decimalTeste) = 10 Then
            'eh portugues
            dec = Convert.ToDecimal(strTexto.Replace(".", ","))
        End If
        Return dec
    End Function
End Class
